package com.dzl.config.exception;

import com.dzl.util.HttpCode;
import lombok.Data;

@Data
public class CommonException extends RuntimeException {

    private int code;

    private String message;

    public CommonException(int code, String msg) {
        this.code = code;
        this.message = msg;
    }

    public CommonException(String msg) {
        this.code = HttpCode.FAILURE.getCode();
        this.message = msg;
    }

    public CommonException(HttpCode httpCode) {
        this.code = httpCode.getCode();
        this.message = httpCode.getMsg();
    }

}
